<!DOCTYPE html>

<!-- BEGIN html -->
<html>

    <!-- BEGIN head -->
    <head>
        <?php echo $this->facebook?>
        <!-- Title -->
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        
        <!-- Meta tags -->
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=100%; initial-scale=1; minimum-scale=1;" />

        <!-- Favicon -->
        <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />

        <!-- Stylesheets -->
        <link rel="stylesheet" href="<?php echo urlCss(); ?>small/main-stylesheet.css" type="text/css" />
        <link rel="stylesheet" href="<?php echo urlJs(); ?>plugins/messi/messi.css" type="text/css" />
        <!--[if lt IE 9]><link rel="stylesheet" href="<?php echo urlCss(); ?>big/ie678-fix.css" type="text/css" type="text/css" /><![endif]-->
        <!--<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,vietnamese' rel='stylesheet' type='text/css'>-->
        <link href='http://fonts.googleapis.com/css?family=Lobster|Open+Sans&subset=latin,vietnamese' rel='stylesheet' type='text/css'>

        <!-- JavaScripts -->
        
        <script src="<?php echo urlJs(); ?>jquery.min.js" type="text/javascript"></script>
        

        <!-- END head -->
    </head>
    <body class="top">
        <!-- BEGIN .main-body-wrapper -->
        <div class="main-body-wrapper">

            <!-- BEGIN .main-header -->
            <?php $this->widget('HeaderWidget')?>

            <!-- BEGIN .main-slider -->
            

            <!-- BEGIN .main-content-wrapper -->
            <?php echo $content; ?>
            

                <!-- BEGIN .featured-items -->
                

                
            <div class="clear_footer"></div>
            <!-- BEGIN .main-footer-wrapper -->
            <?php $this->widget('FooterWidget')?>
            <div id="payment">
                <form action="<?php echo Yii::app()->createUrl('payment/index')?>" method="post" class="from_submit">
                <table id="info_payment" >
                    <tr>
                        <td width="150">
                            Họ tên <span class="required">*</span>
                        </td>
                        <td>
                            <input type="text" name="AddressForm[name]" class="name" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Địa chỉ <span class="required">*</span>
                        </td>
                        <td>
                            <input type="text" name="AddressForm[address]" class="address"  />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Số điện thoại <span class="required">*</span>
                        </td>
                        <td>
                            <input type="text" name="AddressForm[phone]" class="phone"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Email <span class="required">*</span>
                        </td>
                        <td>
                            <input type="text" name="AddressForm[email]" class="email"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Ghi chú
                        </td>
                        <td>
                            <textarea name="AddressForm[comment]" ></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <input type="submit" value="Mua hàng" id="mua_hang" class="btn btn-danger"/>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td class="error"></td>
                    </tr>
                </table>
               </form>
            </div>
            <!-- END .main-body-wrapper -->
        </div>
        <script src="<?php echo urlJs(); ?>jquery.placeholder.min.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>jquery.uniform.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>jquery.cycle.all.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>jquery.easing.1.3.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>jquery.touchwipe.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>html5shiv.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>plugins/messi/messi.min.js" type="text/javascript"></script>
        <script src="<?php echo urlJs(); ?>theme.js" type="text/javascript"></script>
        <script>
            $(document).ready(function(){
                //
                $("#sort").live('change',function(){
                    $(this).parents('form').submit();
                });
                //
                $('.buttons .checkout').live('click',function(){
                    new Messi($('#payment').html(), {title: 'Thông tin khách hàng'});
                    return false;
                });
                //
                $('.messi .from_submit').live('submit',function(){
                    var name = $(this).find('.name').val();
                    var address = $(this).find('.address').val();
                    var phone = $(this).find('.phone').val();
                    var email = $(this).find('.email').val();
                    var message = "";
                    if(name.length == 0){
                        message += "+ Họ tên không được bỏ trống \n";
                    }
                    if(address.length == 0){
                        message += "+ Địa chỉ không được bỏ trống \n";
                    }
                    if(phone.length == 0){
                        message += "+ Số điện thoại không được bỏ trống \n";
                    }
                    if(email.length == 0){
                        message += "+ Email không được bỏ trống \n";
                    }
                    
                    if(message.length > 0){
                        alert(message);
                        return false;
                    }
                    
                });
            });
            
        </script>
            
        <!-- END body -->
    </body>
</html>